package com.autumn.annotations.leetcode.leet;

import java.security.SecureRandom;
import java.text.DateFormat;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;

/**
 * ClassName: LocaleTest
 * Description:
 * Author: Shen_Yue
 * Date: 2023/8/2 23:35
 * History:
 * <author>          <time>          <version>          <desc>
 * Shen_Yue    2023/8/2 23:35   @Version 1.0        描述
 */
public class LocaleTest {

    // 火锅，烤肉，自助，炒菜
    private static final int Huo_Guo = 0;
    private static final int Kao_Rou = 1;
    private static final int Zi_Zhu = 2;
    private static final int Chao_Cai = 3;

    public static void main(String[] args) {
        int Huo_Guo_Count = 0;
        int Kao_Rou_Count = 0;
        int Zi_Zhu_Count = 0;
        int Chao_Cai_Count = 0;

        for (int i = 0; i < 1000000; i++) {
            int target = getEat();

            if (target == Huo_Guo) {
                Huo_Guo_Count++;
            } else if (target == Kao_Rou) {
                Kao_Rou_Count++;
            } else if (target == Zi_Zhu) {
                Zi_Zhu_Count++;
            } else if (target == Chao_Cai) {
                Chao_Cai_Count++;
            }
        }

        System.out.println("火锅 " + Huo_Guo_Count + " 次投票");
        System.out.println("烤肉 " + Kao_Rou_Count + " 次投票");
        System.out.println("自助 " + Zi_Zhu_Count + " 次投票");
        System.out.println("炒菜 " + Chao_Cai_Count + " 次投票");
    }

    private static int getEat() {
        try {
            SecureRandom seedRandom = SecureRandom.getInstance("SHA1PRNG");
            int number = seedRandom.nextInt(1000);
            return number % 4;
        } catch (Exception e) {
            return 0;
        }
    }
}
